A Generic Programming Extension for Clean

نویسندگان

  • Artem Alimarine
  • Marinus J. Plasmeijer
چکیده

Generic programming enables the programmer to define functions by induction on the structure of types. Defined once, such a generic function can be used to generate a specialized function for any user defined data type. Several ways to support generic programming in functional languages have been proposed, each with its own pros and cons. In this paper we describe a combination of two existing approaches, which has the advantages of both of them. In our approach overloaded functions with class variables of an arbitrary kind can be defined generically. A single generic definition defines a kind-indexed family of overloaded functions, one for each kind. For instance, the generic mapping function generates an overloaded mapping function for each kind. Additionally, we propose a separate extension that allows to specify a customized instance of a generic function for a type in terms of the generated instance for that type.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Teaching Generic Programming

In this paper we explain how we teach generic programming to master students in computer science. Key concepts to transfer are the relation between plain types and their generic representation, kinds, and the function parameters corresponding to arrow kinds. We teach this successfully in three steps, we start with simple solutions, show why they fail and how a more sophisticated variant solves ...

متن کامل

Mathematical Programming Models for Solving Unequal-Sized Facilities Layout Problems - a Generic Search Method

 This paper present unequal-sized facilities layout solutions generated by a genetic search program named LADEGA (Layout Design using a Genetic Algorithm). The generalized quadratic assignment problem requiring pre-determined distance and material flow matrices as the input data and the continuous plane model employing a dynamic distance measure and a material flow matrix are discussed. Computa...

متن کامل

Efficient and Type-Safe Generic Data Storage

In this paper we present an elegant method for sequentializing arbitrary data using the generic language extension of the functional programming language Clean. We show how the proposed operations can be used to store values of any concrete data type in several kinds of IO containers (such as files or arrays of characters), and how to manipulate stored data efficiently. Moreover, by extending s...

متن کامل

When Generic Functions Use Dynamic Values

Dynamic types allow strongly typed programs to link in external code at run-time in a type safe way. Generic programming allows programmers to write code schemes that can be specialized at compiletime to arguments of arbitrary type. Both techniques have been investigated and incorporated in the pure functional programming language Clean. Because generic functions work on all types and values, t...

متن کامل

Employee Job Autonomy and Control in a Restructured Extension Organization

This descriptive cross sectional census study identified the perceptions of Extension and Outreach employees of Iowa State University in the United States about job autonomy and control after two years of a major restructuring. Employees perceived autonomy and control over expressing views and ideas about their work and spending time on the job but perceived little influence over budget allocat...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2001